<html> 
<head><title>General constrained randomization</title></head>
<body bgcolor="#ffffff">
<h3><a name="top"></a>General constrained randomization:<br>
Nonlinearity test for event time series</h3>
There are two specific calling sequence to  generate surrogates
with the same inter-event interval correlations (or spectrum) 
and the same distribution of 
inter-event intervals as the data.
The corresponding null hypothesis is that all the serial correlations in the
data are represented by the autocorrelation function (resp. the power spectrum)
and the histogram of inter-event
intervals. For the definition of the inter-event interval autocorrelation
function (resp. the power spectrum) see
<a href="spikeauto.html">spikeauto</a> 
(resp. <a href="spikespec.html">spikespec</a>).
<p>
<h4>Spike train autocorrelations</h4>
The recommended calling sequence uses the <a href="../surropaper/node26.html">inter-event time autocorelation</a>
function, binned to a given resolution and computed up to a given lag:
<p>
<font color=blue><tt>randomize_spikeauto_exp_random
<font color=red>-d# -D#</font> [-i -W#] <br>&nbsp;&nbsp;&nbsp;&nbsp;[-n# -u# -I# -o </tt><em>outfile</em><tt> -l# -x#
-c# -V# -h -T# -a# -S# -s# -z# -C#] 
</tt><em>file</em></font>
<blockquote>
 <br><font color=red><tt> -d </tt></font>time span of one bin
 <br><font color=red><tt> -D </tt></font>total time spanned
 <br><font color=blue><tt> -i </tt></font>expect intervals rather than times
<br><font color=blue><tt> -W </tt></font>type of average: 
         0=max(c), 1=|c|/lag, 2=(c/lag)**2 (default 0)
<br> <font color=blue><tt> -n </tt></font>number of surrogates (default 1)
<br> <font color=blue><tt> -u </tt></font>improvement factor before write
(default 0.9 = if 10% better)
<br> <font color=blue><tt> -I </tt></font>seed for random numbers (0)
<br><font color=blue><tt> -l </tt></font>maximal number of points to be processed (default all)
   <br> <font color=blue><tt>    -x </tt></font>number of values to be skipped (0) 
   <br> <font color=blue><tt>    -c </tt></font><a href=../general.html#column>column to be read</a> (1 or file,#)
   <br>    <font color=blue><tt>  -o  </tt></font><a href=../general.html#outfile>output file name</a>, just<font color=blue><tt>  -o  </tt></font>means <font color=blue><em>file</em></font><font color=blue><tt>_rnd(_nnn)</tt></font>
<br> <font color=blue><tt> -V </tt></font><a href=../general.html#verbosity>verbosity level</a> (0 = only fatal errors)
<br> <font color=blue><tt> -h </tt></font>show usage message 

<br> <font color=blue><tt> -T </tt></font>
   initial temperature (default: automatic melting)
<br> <font color=blue><tt> -a </tt></font>cooling factor (default automatic)
<br> <font color=blue><tt> -S </tt></font>
   total steps before cooling (default 20000)
<br> <font color=blue><tt> -s </tt></font>
   successful steps before cooling (default 2000)
<br> <font color=blue><tt> -z </tt></font>
   minimal successful steps (default 200)
<br> <font color=blue><tt> -C </tt></font>
   goal value of cost function (default zero)
<p>
   <a href=../general.html#verbosity>verbosity level</a> (add what you want):
<p>
      <font color=blue> 	1</font> = input/output
<br>   <font color=blue> 	2</font> = current value of cost function upon printable improvement
<br>   <font color=blue> 	4</font> = cost mismatch
<br>   <font color=blue> 	8</font> = temperature etc. at cooling
<br>   <font color=blue>   16</font> = verbose cost if improved
<br>   <font color=blue>   32</font> = verbose cost mismatch
</blockquote>
<p>
<h4><a name="spikespec"></a>Spike train spectra</h4>
Alternatively (usually much slower), the inter-event power spectrum can be 
requested at a given range of frequencies:
<p>
<font color=blue><tt>randomize_spikespec_exp_event
[-F# -## -i -W#] <br>&nbsp;&nbsp;&nbsp;&nbsp;[-n# -u# -I# -o </tt><em>outfile</em><tt> -l# -x#
-c# -V# -h -T# -a# -S# -s# -z# -C#] 
</tt><em>file</em></font>
<blockquote>
 <br><font color=blue><tt> -F </tt></font>maximal frequency (2*l / total time)
 <br><font color=blue><tt> -# </tt></font>number of frequencies (F* total time /2)
 <br><font color=blue><tt> -i </tt></font>expect intervals rather than times
<br><font color=blue><tt> -W </tt></font>type of average: 
         0=max(s) 1=|s|/f 2=(s/f)**2 3=|s| (default 0)
<br> <font color=blue><tt> -n </tt></font>number of surrogates (default 1)
<br> <font color=blue><tt> -u </tt></font>improvement factor before write
(default 0.9 = if 10% better)
<br> <font color=blue><tt> -I </tt></font>seed for random numbers (0)
<br><font color=blue><tt> -l </tt></font>maximal number of points to be processed (default all)
   <br> <font color=blue><tt>    -x </tt></font>number of values to be skipped (0) 
   <br> <font color=blue><tt>    -c </tt></font><a href=../general.html#column>column to be read</a> (1 or file,#)
   <br>    <font color=blue><tt>  -o  </tt></font><a href=../general.html#outfile>output file name</a>, just<font color=blue><tt>  -o  </tt></font>means <font color=blue><em>file</em></font><font color=blue><tt>_rnd(_nnn)</tt></font>
<br> <font color=blue><tt> -V </tt></font><a href=../general.html#verbosity>verbosity level</a> (0 = only fatal errors)
<br> <font color=blue><tt> -h </tt></font>show usage message 

<br> <font color=blue><tt> -T </tt></font>
   initial temperature (default: automatic melting)
<br> <font color=blue><tt> -a </tt></font>cooling factor (default automatic)
<br> <font color=blue><tt> -S </tt></font>
   total steps before cooling (default 20000)
<br> <font color=blue><tt> -s </tt></font>
   successful steps before cooling (default 2000)
<br> <font color=blue><tt> -z </tt></font>
   minimal successful steps (default 200)
<br> <font color=blue><tt> -C </tt></font>
   goal value of cost function (default zero)
<p>
   <a href=../general.html#verbosity>verbosity level</a> (add what you want):
<p>
      <font color=blue> 	1</font> = input/output
<br>   <font color=blue> 	2</font> = current value of cost function upon printable improvement
<br>   <font color=blue> 	4</font> = cost mismatch
<br>   <font color=blue> 	8</font> = temperature etc. at cooling
<br>   <font color=blue>   16</font> = verbose cost if improved
<br>   <font color=blue>   32</font> = verbose cost mismatch
</blockquote>
<font color=red><b>Note:</b></font> if neither <font
color=blue><tt>-a</tt></font> nor <font color=blue><tt>-C</tt></font> are
given, the annealing will keep starting over with slower cooling rates. This
may be necessary if good guesses are not available but of course, multiple 
surrogates will have to be made by further separate calls.
<p>
<a href="randomize.html">Constrained Randomization</a> * <a href="../contents.html">Table of Contents</a> * <a href="../../index.html" target="_top">TISEAN home</a>
</body></html>

